#!/usr/bin/env python

import wx

import __messages as messages

from wx.lib.splitter import MultiSplitterWindow

class Messages(wx.Panel):
    '''Messages class
    
    @author Julot <andy.julot@gmail.com>
    @since Tuesday, February 21, 2012. 02:05 PM'''
    
    def __init__(self, parent):
        super(Messages, self).__init__(parent)
        
        self.vSplitter = wx.SplitterWindow(self, style=wx.SP_LIVE_UPDATE)
        self.vSplitter.SetMinimumPaneSize(50)
        
        style = wx.BORDER_THEME | wx.TAB_TRAVERSAL
        panel = wx.Panel(self.vSplitter, style=style)
        
        self.hSplitter = MultiSplitterWindow(panel, style=wx.SP_LIVE_UPDATE)
        self.hSplitter.SetOrientation(wx.VERTICAL)
        
        self.messages = messages.Messages(self.hSplitter)
        self.message = messages.Message(self.hSplitter)
        
        self.hSplitter.AppendWindow(self.messages)
        self.hSplitter.AppendWindow(self.message)

        self.toolBar = messages.ToolBar(panel)
        
        sizer = wx.BoxSizer(wx.VERTICAL)
        sizer.Add(self.toolBar, 0, wx.GROW)
        sizer.Add(self.hSplitter, 1, wx.GROW)
        panel.SetSizer(sizer)
        
        self.labels = messages.Labels(self.vSplitter)
        
        self.vSplitter.SplitVertically(self.labels, panel)
        
        sizer = wx.BoxSizer(wx.VERTICAL)
        sizer.Add(self.vSplitter, 1, wx.GROW)
        self.SetSizer(sizer)
        